約 4,239,920 件
https://w.atwiki.jp/autohotkey_v2/pages/16.html
バージョン2.0.2 © 2014 Steve Gray、Chris Mallett、部分 © AutoIt チームおよびその他多数 ソフトウェア ライセンス GNU 一般公衆利用許諾契約書 クイックリファレンス 入門: プログラムの使い方 チュートリアル サンプルコードの実行方法 ホットキーの書き方 キーストロークの送信方法 プログラムの実行方法 ウィンドウの管理方法 tidbit による初心者向けチュートリアル AutoHotkey をサポートするテキスト エディター よくある質問 スクリプト 概念と規約 知っておくべきさまざまなことの説明。 スクリプト言語 スクリプトの書き方。 その他のトピック 組み込み関数のリスト 変数と式 関数の使い方 オブジェクト インタラクティブなデバッグ キーボードとマウス ホットキー (マウス、ジョイスティック、およびキーボード ショートカット) ホットストリングと自動置換 キーとボタンの再マッピング キー、マウス ボタン、およびジョイスティック コントロールのリスト その他: DllCall 正規表現のクイック リファレンス 謝辞 1999 年に AutoIt v2 をフリー ソフトウェアとしてリリースしてくださった Jonathan Bennett に特別な感謝を捧げます。彼の寛大さは、私自身や世界中の多くの人々にインスピレーションを与え、時間を節約してくれました。さらに、AutoIt v2 コマンド セットに対する AutoHotkey の拡張機能の多く、ならびに Window Spy および古いスクリプト コンパイラは、AutoIt v3 ソース コードから直接適用されました。Jon と他の AutoIt の作成者にも感謝します。 最後に、AutoHotkey は、これらの他の個人なしでは今日のようにはなりませんでした。 〜クリス・マレット https //www.autohotkey.com/docs/v2/index.htm
https://w.atwiki.jp/autohotkey_v2/
バージョン2.0.2 © 2014 Steve Gray、Chris Mallett、部分 © AutoIt チームおよびその他多数 ソフトウェア ライセンス GNU 一般公衆利用許諾契約書 クイックリファレンス 入門: プログラムの使い方 チュートリアル ・サンプルコードの実行方法 ・ホットキーの書き方 ・キーストロークの送信方法 ・プログラムの実行方法 ・ウィンドウの管理方法 ・tidbit による初心者向けチュートリアル AutoHotkey をサポートするテキスト エディター よくある質問 スクリプト 概念と規約 知っておくべきさまざまなことの説明。 スクリプト言語 スクリプトの書き方。 その他のトピック 組み込み関数のリスト 変数と式 関数の使い方 オブジェクト インタラクティブなデバッグ キーボードとマウス ホットキー (マウス、ジョイスティック、およびキーボード ショートカット) ホットストリングと自動置換 キーとボタンの再マッピング キー、マウス ボタン、およびジョイスティック コントロールのリスト その他: DllCall 正規表現のクイック リファレンス 謝辞 1999 年に AutoIt v2 をフリー ソフトウェアとしてリリースしてくださった Jonathan Bennett に特別な感謝を捧げます。彼の寛大さは、私自身や世界中の多くの人々にインスピレーションを与え、時間を節約してくれました。さらに、AutoIt v2 コマンド セットに対する AutoHotkey の拡張機能の多く、ならびに Window Spy および古いスクリプト コンパイラは、AutoIt v3 ソース コードから直接適用されました。Jon と他の AutoIt の作成者にも感謝します。 最後に、AutoHotkey は、これらの他の個人なしでは今日のようにはなりませんでした。 〜クリス・マレット
https://w.atwiki.jp/autohotkey_v2/pages/14.html
この文書は、コードよりも説明に重点を置いて、AutoHotkeyで使用されるいくつかの一般的な概念と慣習をカバーしています。読者はスクリプトやプログラミングの予備知識を持っていることは想定されていませんが、新しい用語を学ぶ準備はしておく必要があります。 構文に関するより具体的な詳細については、「スクリプト言語」を参照してください。 目次 値 文字列 数字 ブール値 nothing オブジェクト オブジェクト・プロトコル 変数 未初期化の変数 組み込み変数 環境変数 変数参照 (VarRef) キャッシング 関数 メソッド 制御フロー 詳細 文字列エンコーディング 純粋数 名前 オブジェクト参照 値 値とは、単にプログラム内の情報の一部です。例えば、送信するキーや実行するプログラムの名前、ホットキーが押された回数、アクティブにするウィンドウのタイトルなど、プログラムまたはスクリプト内で何らかの意味を持つものです。 AutoHotkeyは、これらのタイプの値をサポートしています。 文字列(テキスト) 数字(整数、浮動小数点数) 対象物 Type関数は、値の型を決定するために使用することができます。 その他、関連する概念もあります。 boolean nothing 文字列 文字列は単なるテキストです。各文字列は実際には文字の並びや列であるが、1つの実体として扱うことができる。文字列の長さは、シーケンス内の文字の数であり、文字列内の文字の位置は、単にその文字の連番です。AutoHotkeyの慣例では、最初の文字が位置1になります。 数値文字列。数字の文字列(またはサポートされているその他の数字フォーマット)は、数学演算や比較で必要とされる場合、自動的に数字として解釈されます。 スクリプト内でリテラルテキストをどのように書くべきかは、文脈によって異なります。例えば、式では、文字列は引用符で囲む必要があります。ディレクティブ(#HotIfを除く)と自動置換ホットストリングでは、引用符は必要ありません。 文字列の動作の詳細については、「文字列のエンコード」を参照してください。 数字 AutoHotkey は次の数値形式をサポートしています。 123、00123または などの 10 進整数。-1 0x7B、0x007Bまたは などの 16 進数の整数。-0x1 3.14159のような10進数の浮動小数点数。 ドキュメントに記載されている場合を除き、16 進数は接頭辞0xまたはを使用する必要があります。このプレフィックスは、または記号が存在する場合はその後、先頭のゼロの前に0X記述する必要があります。たとえば、有効ですが、そうではありません。+-0x001000x1 小数点で書かれた数値は、小数部分がゼロであっても、常に浮動小数点と見なされます。たとえば、42と は42.0通常交換可能ですが、常にではありません。科学表記法も認識されますが (例 1.0e4and )、小数点がなくても常に浮動小数点数が生成されます。-2.1E-4 ユーザーの地域設定でコンマが指定されている場合でも、小数点記号は常にドットです。 数値が文字列に変換されると、10 進数として書式設定されます。浮動小数点数は完全な精度でフォーマットされます (ただし、冗長な後続ゼロは破棄されます)。これにより、場合によっては不正確さが明らかになることがあります。Format関数を使用して、数値文字列を別の形式で生成します。浮動小数点数は、Round関数を使用してフォーマットすることもできます。 数値の範囲と精度の詳細については、純粋な数値を参照してください。 ブール値 ブーリアン値は、真または偽のいずれかになります。ブール値は、式の真偽など、2つの可能性を持つものを表現するのに使われます。例えば、式(x = y)は、xがyより小さいか等しい場合に真となります。ブーリアン値は、イエスかノー、オンかオフ、ダウンかアップ(GetKeyStateなど)などを表すこともできます。 AutoHotkeyには特定のブーリアン型がないため、0という整数値でfalseを、1という整数値でtrueを表現します。値が真か偽のどちらかであることが要求される場合、空白またはゼロの値は偽とみなされ、その他の値はすべて真とみなされます(オブジェクトは常に真とみなされます)。 trueとfalseという単語は、1と0を含む組み込み変数です。 nothing AutoHotkeyには、他の言語で見られるような、何もない、null、nil、undefinedを一意に表す値がありません。 Null」または「undefined」値を生成する代わりに、値がない変数、プロパティ、配列要素、またはマップアイテムを読み込もうとすると、UnsetErrorが投げられます。これにより、NULL値が暗黙のうちにコードに伝搬することを許可した場合よりも、より簡単にエラーを特定することができます。こちらも参照してください。未初期化変数」も参照してください。 関数のオプションのパラメータは、関数が呼び出されたときに省略することができます。この場合、関数は動作を変更したり、デフォルト値を使用したりします。パラメータを省略するには、通常、コードから文字通り省略しますが、unsetキーワードを使用して明示的または条件付きで省略することも可能です。この特別なシグナルは、maybe演算子(var?)を使って明示的にのみ伝達することができます。unsetパラメータは、関数が実行される前に自動的にそのデフォルト値(もしあれば)を受け取ります。 主に歴史的な理由から、他の言語で null や undefined 値が使われるような場所、例えば戻り値が明示されていない関数では、空文字列が使われることがあります。 変数やパラメータが「空」または「ブランク」と呼ばれる場合は、通常、空文字列(長さがゼロの文字列)を意味します。これは、パラメータを省略することとは異なりますが、場合によっては同じ効果が得られるかもしれません。 オブジェクト オブジェクトは、 AutoHotkey の複合または抽象データ型です。オブジェクトは、任意の数のプロパティ(取得または設定可能) とメソッド(呼び出し可能)で構成できます。各プロパティまたはメソッドの名前と効果は、特定のオブジェクトまたはオブジェクトの種類によって異なります。 オブジェクトには次の属性があります。 オブジェクトは含まれていません。それらは参照されます。たとえば、alpha = []新しい配列を作成し、参照をalphaに格納します。bravo = alpha(オブジェクトではなく) への参照をコピーするbravoため、両方が同じオブジェクトを参照します。配列または変数がオブジェクトを含むと言われている場合、実際に含まれているのはオブジェクトへの参照です。 2 つのオブジェクト参照は、同じオブジェクトを参照している場合にのみ比較されます。 オブジェクトは、if obj, !obj, obj ? x y のように、ブール値が要求される場合は常に真とみなされます。 各オブジェクトは固有のアドレス(メモリ上の位置)を持っており、ObjPtr関数で取得することができますが、通常は直接使用されることはありません。このアドレスは、オブジェクトを一意に識別しますが、オブジェクトが解放されるまでの間だけです。 オブジェクトが想定外の文脈で使用された場合、空文字列として扱われることがあります。例えば、MsgBox(myObject)は、空のMsgBoxを表示します。それ以外の場合は、TypeErrorが投げられるかもしれません(将来的には、これが標準になるはずです)。 注:Objectから派生したすべてのオブジェクトは、さらに共有の動作、プロパティ、メソッドを持ちます。 オブジェクトの使われ方として、以下のようなものがあります。 アイテムや要素のコレクションを格納する。例えば、Arrayはアイテムのシーケンスを含み、Mapはキーと値を関連付ける。オブジェクトを使用すると、値のグループを1つの値として扱ったり、1つの変数に代入したり、関数に渡したり、関数から返したりすることができます。 現実的または概念的なものを表現すること。例えば、画面上の位置をXとYのプロパティで表し、アドレス帳の連絡先をName、PhoneNumber、EmailAddressなどで表します。オブジェクトは、他のオブジェクトと組み合わせることで、より複雑な情報の集合を表現するために使用することができます。 サービスやサービスの集合をカプセル化することで、スクリプトの他の部分が、そのタスクの実行方法ではなく、タスクに集中できるようにします。例えば、Fileオブジェクトは、ファイルからデータを読み取ったり、ファイルにデータを書き込んだりするメソッドを提供します。ファイルに情報を書き込むスクリプト関数が、Fileオブジェクトをパラメータとして受け取った場合、ファイルがどのように開かれたかを知る必要はありません。同じ関数を使用して、TCP/IPソケットやWebSocketなどの他のターゲットに情報を書き込むことができます(ユーザー定義オブジェクトを使用)。 上記の組み合わせ。例えば、GUIはGUIウィンドウを表し、スクリプトにグラフィカルユーザーインターフェースを作成、表示する手段を提供します。コントロールのコレクションを含み、タイトルやFocusedCtrlなどのプロパティによってウィンドウに関する情報を提供します。 オブジェクト(特にクラス)を適切に使用することで、モジュール化され再利用可能なコードを作成することができます。モジュール化されたコードは、通常、テスト、理解、保守が容易です。例えば、あるコードのセクションを改良したり変更したりする際に、他のセクションの詳細を知る必要がなく、またそのセクションに対応する変更を加える必要もありません。再利用可能なコードは、同じまたは類似のタスクのコードを何度も書いたりテストしたりする必要がないため、時間を節約することができます。 オブジェクト・プロトコル このセクションは、後のセクションでカバーされるこれらの概念に基づいています:変数、関数。 オブジェクトは、メッセージパッシングの原理で動作します。オブジェクトのコードや変数が実際にどこにあるかはわからないので、「give me foo」や「go do bar」のようにオブジェクトにメッセージを渡し、オブジェクトがそのメッセージに応答するのを頼りにする必要があります。AutoHotkeyのオブジェクトは、以下の基本的なメッセージをサポートしています。 プロパティを取得します。 プロパティを設定します( =で示されます)。 メソッドを呼び出す、()で示される。 プロパティは、設定や取得が可能なオブジェクトのいくつかの側面です。例えば、ArrayにはLengthプロパティがあり、これは配列の要素数に対応する。プロパティを定義すると、そのプロパティはどんな意味でも持つことができます。一般的に、プロパティは変数のように機能しますが、その値は必要に応じて計算され、実際にはどこにも保存されないかもしれません。 各メッセージには以下の内容が含まれており、通常はプロパティまたはメソッドが呼び出される場所に書かれています。 プロパティまたはメソッドの名前。 プロパティまたはメソッドの名前。どのようなアクションが実行されるか、値がどのように保存されるか、またはどの値が返されるかに影響を与える可能性のあるゼロ個以上のパラメータ。例えば、プロパティは、配列のインデックスやキーを取ることがあります。 例えば、次のようなものです。 myObj.methodName(arg1) value = myObj.propertyName[arg1] オブジェクトにはデフォルトのプロパティもあり、プロパティ名なしで角括弧を使用すると、このプロパティが呼び出されます。例えば、次のようなものです。 value = myObj[arg1] 一般にSetは代入と同じ意味を持つので、同じ演算子を使います。 myObj.name = value myObj.name[arg1, arg2, ..., argN] = value myObj[arg1, arg2, ..., argN] = value 変数 変数では、名前を値のプレースホルダーとして使用することができます。その値は、スクリプトの実行中に繰り返し変更される可能性があります。例えば、ホットキーの場合、変数press_countを使って押された回数をカウントし、press_countが3の倍数のとき(3回押すごとに)別のキーを送信することができます。一度しか値が割り当てられない変数でも、役に立つことがあります。例えば、WebBrowserTitleという変数を使えば、好みのWebブラウザを変更したり、ソフトウェアのアップデートでタイトルやウィンドウクラスが変わったりしたときに、コードを更新しやすくすることができます。 AutoHotkeyでは、変数は単に使用することで作成されます。各変数は永久に単一のデータ型に制限されることはなく、代わりに文字列、数値、オブジェクトなど、任意の型の値を保持することができます。値が割り当てられていない変数を読もうとするとエラーとみなされるので、変数を初期化することは重要です。 変数には、主に3つの側面があります。 変数の名前。 変数名 変数の値 変数名には一定の制限があり、詳細は「名前」を参照してください。要するに、ASCII文字(大文字小文字を区別しない)、数字、アンダースコアからなる名前にこだわるのが最も安全であり、数字から始まる名前は使わないようにしましょう。 変数名にはスコープがあり、コード内のどこでその名前を使用してその変数を参照できるか、言い換えれば、その変数が見えるかどうかを定義します。ある変数が与えられたスコープ内で見えない場合、同じ名前で別の変数を参照することができます。両方の変数が同時に存在することもあるが、スクリプトの各部分で見えるのは1つだけである。グローバル変数は、「グローバルスコープ」(つまり関数の外側)で見ることができ、デフォルトで関数から読み取ることができますが、関数内で値を割り当てる場合は宣言する必要があります。ローカル変数は、それを作成した関数の内部でのみ見ることができます。 変数は、値を格納する容器または格納場所と考えることができるので、ドキュメントでは、変数の値を変数の中身と呼ぶことがよくあります。変数x =42の場合、変数xの値として42という数字がある、あるいはxの値は42である、とも言えます。 注意しなければならないのは、変数とその値は同じものではないということです。例えば、「myArrayは配列である」と言うかもしれませんが、本当の意味は「myArrayは配列への参照を含む変数である」ということです。しかし、「myArray」は単なる変数名であり、配列オブジェクトはその名前を知らないので、さまざまな変数(したがって多くの名前)で参照される可能性があります。 未初期化の変数 変数を初期化するとは、その変数に開始値を割り当てることである。まだ値が割り当てられていない変数は、未初期化(略して未設定)です。初期化されていない変数を読み込もうとすると、エラーとみなされます。このため、名前の間違えや代入のし忘れなどのエラーを検出することができます。 IsSetは、グローバル変数やスタティック変数の初回使用時の初期化など、変数が初期化されているかどうかを判断するために使用できます。 変数の設定を解除するには、直接代入( =)とunsetキーワード、またはmaybe(var?)演算子を組み合わせます。例えば、以下のようになります。Var = unset, Var1 = (Var2?). or-maybe演算子(??)は、変数に値がない場合にデフォルト値を提供するために使用することができます。例えば、MyVar ? "Default "は、IsSet(MyVar) ?と同等です。MyVar "Default "と同じです。 組み込み変数 プログラムには便利な変数が多数組み込まれており、どのスクリプトからも参照することができます。これらの変数は、注意書きがある場合を除き、読み取り専用です。つまり、スクリプトで直接内容を変更することはできません。慣習上、これらの変数のほとんどは接頭辞 A_ で始まります。 A_KeyDelayやA_TitleMatchModeなどの一部の変数は、スクリプトの動作を制御する設定を表し、各スレッドに対して別々の値を保持します。これにより、新しいスレッドで起動したサブルーチン(ホットキー、メニュー、タイマーなど)が、他のスレッドに影響を与えずに設定を変更することができます。 特殊な変数の中には、定期的に更新されるのではなく、スクリプトがその変数を参照するたびに値が取得されたり計算されたりするものがあります。例えば、A_Clipboardはクリップボードの現在の内容をテキストとして取得し、A_TimeSinceThisHotkeyはホットキーが押されてから経過したミリ秒数を計算する。 関連:組み込み変数の一覧。 環境変数 環境変数は、オペレーティングシステムによって管理されています。コマンドプロンプトでSETと入力してEnterを押すと、環境変数の一覧が表示されます。 スクリプトは、EnvSetを使用して新しい環境変数を作成したり、既存の環境変数の内容を変更したりすることができます。このような追加や変更は、システムの他の部分からは見えません。しかし、スクリプトがRunまたはRunWaitを呼び出して起動したプログラムやスクリプトは、通常、親スクリプトの環境変数のコピーを引き継ぎます。 環境変数を取得するには、EnvGetを使用します。たとえば、次のようになります。 Path = EnvGet( PATH ) 変数参照(VarRef) 式中では、代入や参照演算子( )の対象でない限り、各変数参照はその内容に自動的に解決されます。つまり、myFunction(myVar)を呼び出すと、myVarの値がmyFunctionに渡され、変数そのものは渡されません。すると、関数はmyVarと同じ値を持つ独自のローカル変数(パラメータ)を持つことになるが、myVarに新しい値を代入することはできない。要するに、パラメータは値で渡されるのです。 参照演算子( )は、変数を値のように扱うことができます。 myVarはVarRefを生成し、他の変数やプロパティへの代入、配列への挿入、関数への受け渡し、関数からの戻り値など、他の値と同様に使用することができます。VarRefは、元のターゲット変数に割り当てたり、それを再参照することでその値を取得するために使用することができます。 関数のパラメータは、パラメータ名の前にアンパサンド( )を付けることでByRefとして宣言することができ、便利です。この場合、呼び出し側ではVarRefを渡す必要がありますが、関数自身はパラメータを参照するだけで(パーセント記号なしで)VarRefを「参照解除」することが可能です。 Path = EnvGet( PATH )class VarRef extends Any VarRef クラスには現在、定義済みのメソッドやプロパティはありませんが、value is VarRef を使用すると、値が VarRef であるかどうかをテストすることが可能です。 VarRef が COM メソッドのパラメーターとして使用される場合、オブジェクト自体は渡されません。代わりに、その値は一時的な VARIANT にコピーされ、それはバリアント型 VT_BYREF|VT_VARIANT を使用して渡されます。メソッドが戻ると、新しい値がVarRefに割り当てられます。 キャッシング 通常、変数は1つの値を保持し、その値は明確な型(文字列、数値、オブジェクト)を持っていると考えられていますが、AutoHotkeyでは、「値は" myNumber」や「MsgBox myNumber」などの場合、数値と文字列を自動的に変換しています。これらの変換は非常に頻繁に行われるため、数値を含む変数が文字列に変換されるたびに、その結果が変数にキャッシュされます。 現在、AutoHotkey v2では、純粋な数値を変数に代入するときだけキャッシュし、読み込むときはキャッシュしません。これにより、文字列と純粋な数値を区別する機能が維持されます(Type関数や、COMオブジェクトに値を渡す場合など)。 関連 変数:基本的な使い方と例。 変数容量とメモリ:制限事項の詳細。 関数 関数とは、スクリプトが何かを行うための基本的な手段です。 関数は、さまざまな目的を持つことができます。単純な計算を行うだけの関数もあれば、ウィンドウを移動させるなど、すぐに目に見える効果をもたらす関数もあります。AutoHotkeyの強みの1つは、スクリプトがいくつかの関数を呼び出すだけで、他のプログラムを自動化したり、他の多くの一般的なタスクを実行したりすることが簡単にできることです。例については、関数リストを参照してください。 この文書では、経験のない人にはわからないような方法で、いくつかの一般的な単語が使用されています。以下に、関数に関連して頻繁に使用される単語やフレーズをいくつか紹介します。 関数を呼び出す 関数を呼び出すと、プログラムはその関数を呼び出し、実行し、評価する。つまり、関数呼び出しは、一時的にスクリプトから関数に制御を移します。関数が目的を果たすと、制御をスクリプトに戻します。言い換えれば、関数呼び出しに続くコードは、関数が完了するまで実行されません。 しかし、時には、その効果がユーザーに伝わる前に関数が完了することがあります。例えば、Send関数はキーストロークを送信しますが、キーストロークが目的地に到達して意図した効果をもたらす前に戻ることがあります。 パラメータ 通常、関数は、操作方法や操作対象を指示するパラメータを受け取ります。各パラメーターは、文字列や数値などの値です。例えば、WinMoveはウィンドウを移動させるので、どのウィンドウをどこに移動させるかをパラメータで指定します。パラメータは、引数とも呼ばれます。一般的な略語としては、paramやargがあります。 パラメータを渡す パラメータは関数に渡されます。つまり、関数が呼び出されたときに、関数の各パラメータに対して値が指定されます。例えば、GetKeyStateにキーの名前を渡すと、そのキーが押されているかどうかを判断することができます。 コマンド 関数呼び出しは、プログラムに特定の動作をさせる場合など、コマンドと呼ばれることもあります。(歴史的な理由から、コマンドは、括弧が省略され、戻り値が破棄される、特定のスタイルの関数呼び出しを指す場合があります。しかし、これは厳密には関数呼び出し文である)。 関数は通常、パラメータを特定の順序で記述することを想定しているので、各パラメータの値の意味は、カンマで区切られたパラメータリストの中での位置によって決まります。パラメータによっては省略できるものもあり、その場合はパラメータを空白にすることができますが、それに続くカンマは、残りのすべてのパラメータも省略する場合にのみ省略することができます。たとえば、ControlSendの構文は次のとおりです。 ControlSend Keys[, Control, WinTitle, WinText, ExcludeTitle, ExcludeText] 角括弧は、囲んだパラメータがオプションであることを意味します(括弧自体は実際のコードに表示されません)。ただし、通常はターゲットウィンドウを指定する必要があります。例えば ControlSend ^{Home} , Edit1 , A ; Correct. Control is specified. ControlSend ^{Home} , A ; Incorrect Parameters are mismatched. ControlSend ^{Home} ,, A ; Correct. Control is omitted. メソッド メソッドは、特定のオブジェクトやオブジェクトの種類に関連付けられた関数である。メソッドを呼び出すには、オブジェクトとメソッド名を指定する必要があります。メソッド名は関数を一意に特定するものではなく、メソッド呼び出しが試みられたときに何が起こるかはオブジェクトに依存する。例えば、x.Show()は、xが何であるかによって、メニューを表示したり、GUIを表示したり、エラーを発生させたり、何か他のことをしたりするかもしれない。つまり、メソッドコールは単にオブジェクトにメッセージを渡し、何かをするように指示するものです。詳しくは、「オブジェクトのプロトコル」と「オブジェクトの演算子」を参照してください。 制御フロー 制御フローとは、個々のステートメントが実行される順序のことです。通常、ステートメントは上から下へ順番に実行されますが、制御フローステートメントでは、ステートメントを繰り返し実行したり、特定の条件が満たされた場合にのみ実行するように指定することで、これを上書きすることができます。 ステートメント ステートメントとは、簡単に言えば、実行すべき何らかのアクションを表現する、言語の最小の独立した要素のことです。AutoHotkeyでは、ステートメントには、代入、関数呼び出し、その他の式が含まれます。ただし、ディレクティブ、ダブルコロンのホットキーとホットストリングタグ、割り当てのない宣言はステートメントではなく、プログラムが最初に起動したとき、スクリプトが実行される前に処理されます。 実行する 実行する、実行する、評価する、実行に移す、など。Executeは、基本的にノンプログラミングの言葉と同じ意味です。 ボディ 制御フロー文の本文は、その文が適用される文または文のグループです。例えば、if文の本体は、特定の条件が満たされた場合にのみ実行される。 例えば、次のような簡単な手順を考えてみましょう。 メモ帳を開く メモ帳が画面に表示されるのを待つ "ハロー、ワールド!"と入力する 一度に1つのステップを踏んで、そのステップが終わると次のステップに進むのです。これと同じように、プログラムやスクリプトの制御も、ある文から次の文へと流れていくのが普通です。しかし、既存のメモ帳に入力する場合はどうでしょうか。次のような手順で考えてみましょう。 1.メモ帳が起動していない場合 1.メモ帳が起動していない場合:メモ帳を開く 2.メモ帳が画面に表示されるのを待つ 2.それ以外の場合 1.メモ帳を起動する 3."ハロー、ワールド!"と入力する。 つまり、メモ帳を開くか、メモ帳を起動するかは、すでに起動しているかどうかによります。#1.は条件文であり、if文とも呼ばれる。つまり、ある条件を満たした場合にのみ、その本体(#1.1~#1.2)を実行する。#2.はelse文で、前のif文(#1)の条件が満たされない場合にのみ、その本体(#2.1)を実行する。条件によって、制御は次の2つのうちどちらかに流れます。#1(真の場合)→#1.1→#1.2→#3、または#1(偽の場合)→#2(else)→#2.1→#3です。 上記の命令は、以下のようなコードに変換することができます。 if (not WinExist( ahk_class Notepad )) { Run Notepad WinWait ahk_class Notepad } else WinActivate ahk_class Notepad Send Hello, world{!} 文書による指示では、インデントと番号を使ってステートメントをグループ化しました。スクリプトの動作は少し異なります。インデントはコードを読みやすくしますが、AutoHotkeyでは、ステートメントのグループ化には影響しません。その代わり、上図のように中括弧で囲むことでステートメントをグループ化します。これをブロックと呼びます。 構文についての詳細、つまりAutoHotkeyで制御フロー文を書く、または認識する方法については、「制御フロー」を参照してください。 詳細 文字列のエンコード 文字列の各文字は、その序数(文字コード)と呼ばれる数字で表現されます。例えば、"Abc "という値は次のように表されます。 A b c 65 98 99 0 エンコーディング 文字列のエンコーディングは、記号が序数に、序数がバイトにどのようにマッピングされるかを定義します。多くの異なるエンコーディングがありますが、AutoHotkeyでサポートされているものはすべてASCIIをサブセットとして含んでいるので、文字コード0から127は常に同じ意味を持っています。例えば、 A は常に文字コード65を持ちます。 Null-termination (ヌル文字) 各文字列は「ヌル文字」で終了します。言い換えれば、序列値がゼロの文字が文字列の終わりを示すことになります。文字列の長さは、ヌル終端文字の位置から推測できますが、AutoHotkeyは、パフォーマンスのため、また文字列の長さの範囲内でヌル文字を許可するために、長さも保存します。 注:ヌル終端処理に依存しているため、多くの組み込み関数とほとんどの式演算子はヌル文字が埋め込まれた文字列をサポートしておらず、代わりに最初のヌル文字までしか読みません。しかし、このような文字列の基本的な操作は可能です。例えば、連結、==、!==、Chr(0)、StrLen、SubStr、代入、パラメータ値、戻り値などです。 ネイティブエンコーディング。AutoHotkeyは様々なエンコーディングのテキストを扱う方法を提供していますが、組み込み関数、そしてある程度言語自体が、すべて文字列値がある特定のエンコーディングであることを前提としています。これはネイティブエンコーディングと呼ばれるものです。ネイティブエンコーディングは、AutoHotkeyのバージョンに依存します。 AutoHotkeyのUnicodeバージョンはUTF-16を使用します。UTF-16文字列の最小要素は2バイト(16ビット)です。0から65535(U+FFFF)の範囲のUnicode文字は、同じ値の単一の16ビットコードユニットで表され、65536(U+10000)から1114111(U+10FFFF)の範囲の文字は、サロゲートペアで表されます(つまり、0xD800から0xDFFFまでのちょうど二つの16ビットコードユニットです。(サロゲートペアの詳しい説明やエンコード、デコードの方法については、インターネットを検索してください)。 AutoHotkeyのANSIバージョンは、システムのロケールまたは「非Unicodeプログラム用の言語」システム設定に依存する、システムのデフォルトANSIコードページを使用します。ANSI文字列の最小の要素は1バイトです。ただし、コードページによっては、複数バイトのシーケンスで表現される文字が含まれています(これらは常に非ASCII文字です)。 注:AutoHotkey v2はネイティブでUnicodeを使用し、ANSIバージョンはありません。 文字。一般に、この文書の他の部分では、文字列の最小単位を意味する用語「文字」を使用しています。ANSI文字列ではバイト、Unicode(UTF-16)文字列では16ビットコードユニットです。実用的な理由から、文字列の長さや文字列内の位置は、完全なUnicode文字でなくても、これらの固定サイズの単位を数えることによって測定されます。 FileRead、FileAppend、FileOpen、Fileオブジェクトは、特定のエンコーディングを持つファイル内のテキストの読み書きの方法を提供します。 StrGetとStrPut関数は、ネイティブエンコーディングと他の指定されたエンコーディングの間で文字列を変換するために使用することができます。しかし、これらは通常、データ構造やDllCall関数と組み合わせた場合にのみ有効です。DllCallに直接渡される文字列やDllCallから渡される文字列は、AStrやWStrのパラメータ型を使用してANSIやUTF-16に変換することができます。 AutoHotkeyのANSIバージョンとUnicodeバージョンの違いを扱うためのテクニックは、Unicode vs ANSIで見つけることができます。 純粋数 純粋数または2進数は、コンピュータのCPUが直接演算処理できる形式でメモリに保存されているものです。ほとんどの場合、AutoHotkeyは必要に応じて数値文字列と純粋数を自動的に変換し、この2つのタイプを区別することはほとんどありません。AutoHotkeyは、主に純粋な数値に2つのデータ型を使用します。 64ビット符号付き整数(int64)。 64ビットバイナリ浮動小数点数(IEEE 754国際標準のdoubleまたはbinary64フォーマット)。 つまり、スクリプトは以下の制限に影響される。 つまり、-9223372036854775808(-0x800000000000、または-263)から9223372036854775807(0x7FFFFFFFFF、または263-1)の範囲内でなければならない。式中の整数定数がこの範囲外の場合、下位64ビットのみが使用されます(値は切り捨てられます)。より大きな値を文字列に含めることもできますが、文字列を数値に変換しようとすると(数学の演算で使用するなど)、同様に切り捨てられることになります。 浮動小数点数は、一般に15桁の精度をサポートします。 注:2進浮動小数点形式では正確に表現できない10進数の分数があるため、表現可能な最も近い数値に丸められます。そのため、最も近い数値に丸められ、予想外の結果になることがあります。例えば MsgBox 0.1 + 0 ; 0.10000000000000001 MsgBox 0.1 + 0.2 ; 0.30000000000000004 MsgBox 0.3 + 0 ; 0.29999999999999999 MsgBox 0.1 + 0.2 = 0.3 ; 0 (not equal) その対策として、直接の比較を避け、代わりに違いを比較することがあります。例えば MsgBox Abs((0.1 + 0.2) - (0.3)) 0.0000000000000001 もう一つの方法は、文字列に変換するなどして、比較の前に明示的に丸めを適用することである。精度を指定しながらこれを行うには、一般に2つの方法があり、どちらも以下に示すとおりです。 MsgBox Round(0.1 + 0.2, 15) = Format( { .15f} , 0.3) 名称 AutoHotkeyでは、変数、関数、ウィンドウグループ、クラス、プロパティ、メソッドなど、さまざまなものの命名に、同じルールを使用しています。そのルールは以下の通りです。 大文字と小文字を区別する。ASCII 文字の場合はなし。例えば、CurrentDateはcurrentdateと同じです。しかし、 Ä のような大文字の非ASCII文字は、現在のユーザーのロケールに関係なく、小文字の対応する文字と同等とはみなされません。これは、スクリプトが複数のロケール間で一貫した動作をするのに役立ちます。 最大文字数:253文字 使用可能な文字。文字、数字、アンダースコア、非ASCII文字。ただし、1文字目は数字にできません。 予約語:as, and, contains, false, in, is, IsSet, not, or, super, true, unset. これらの単語は、将来の使用やその他の特定の目的のために予約されています。 宣言キーワードや制御フロー文の名前も、主に間違いを検出するために予約されています。これには次のようなものがあります。Break、Catch、Continue、Else、Finally、For、Global、Goto、If、Local、Loop、Return、Static、Throw、Try、Until、While。 プロパティ名、メソッド名、ウィンドウグループ名には予約語を使用することができる。 オブジェクト参照 スクリプトは、オブジェクトへの参照を通じて、間接的にのみオブジェクトと対話します。オブジェクトを作成するとき、オブジェクトはあなたがコントロールできない場所に作成され、あなたに参照が与えられます。この参照を関数に渡したり、変数や別のオブジェクトに格納したりすると、同じオブジェクトへの新しい参照が作成されます。 例えば、myObjにオブジェクトへの参照が含まれている場合、yourObj = myObjは同じオブジェクトへの新しい参照を作成する。myObj.ans = 42 のような変更は、myObj.ans と yourObj.ans の両方が同じオブジェクトを参照しているため、反映されるでしょう。しかし、myObj = Object()は変数myObjにのみ影響し、変数yourObjはまだ元のオブジェクトを参照しているわけではありません。 参照は、単に代入を使って他の値に置き換えることで解放されます。オブジェクトは、すべての参照が解放された後にのみ削除されます。オブジェクトを明示的に削除することはできませんので、試してはいけません。(ただし、オブジェクトのプロパティ、コンテンツ、関連リソース(Arrayの要素、Guiに関連するウィンドウ、Menuオブジェクトのメニューなど)は削除することができます)。 ref1 = Object() ; Create an object and store first reference ref2 = ref1 ; Create a new reference to the same object ref1 = ; Release the first reference ref2 = ; Release the second reference; object is deleted もし理解しにくければ、オブジェクトをレンタルユニットとみなしてみてください。借りるときに渡されるのは、その部屋に入るための鍵です。そして、その鍵を使って同じユニットにアクセスすることができるのですが、そのユニットを使い終わったら、すべての鍵をレンタル業者に返さなければなりません。通常、ユニットは削除されませんが、オブジェクトに保存された値が削除されると解放されるのと同じように、エージェントは、あなたが残したガラクタを削除してくれるかもしれませんね。 https //www.autohotkey.com/docs/v2/Concepts.htm#variable-references
https://w.atwiki.jp/autohotkey_v2/pages/12.html
このドキュメントでは、コードではなく説明に焦点を当てて、AutoHotkey で使用されるいくつかの一般的な概念と規則について説明します。読者は、スクリプトやプログラミングの予備知識を持っているとは想定されていませんが、新しい用語を習得する準備ができている必要があります。 構文の詳細については、Scripting Languageを参照してください。 目次 値 ストリングス 数字 ブール値 なし オブジェクト オブジェクト プロトコル 変数 初期化されていない変数 組み込み変数 環境変数 変数参照 (VarRef) キャッシング 機能 メソッド 制御フロー 詳細 文字列エンコーディング 純粋な数字 名前 オブジェクトへの参照 値 値は、プログラム内の単なる情報です。たとえば、送信するキーまたは実行するプログラムの名前、ホットキーが押された回数、アクティブにするウィンドウのタイトル、またはプログラムまたはスクリプト内で何らかの意味を持つその他のもの。 AutoHotkey は、次のタイプの値をサポートしています。 文字列(テキスト) 数値(整数および浮動小数点数) オブジェクト Type関数を使用して、値の型を判別できます。 その他の関連する概念 ブール値 なし ストリングス 文字列は単なるテキストです。各文字列は、実際には一連の文字列または文字列ですが、1 つのエンティティとして扱うことができます。文字列の長さはシーケンス内の文字数ですが、文字列内の文字の位置は単にその文字の連続番号です。AutoHotkey の慣例により、最初の文字の位置は 1 です。 数値文字列 数字の文字列 (またはサポートされているその他の数値形式) は、数学演算または比較で必要になると、自動的に数値として解釈されます。 スクリプト内でリテラル テキストをどのように記述するかは、コンテキストによって異なります。たとえば、式では、文字列を引用符で囲む必要があります。ディレクティブ (#HotIf を除く) とホットストリングの自動置換では、引用符は必要ありません。 文字列の仕組みの詳細については、文字列のエンコードを参照してください。 数字 AutoHotkey は次の数値形式をサポートしています。 123、00123または などの 10 進整数。-1 0x7B、0x007Bまたは などの 16 進数の整数。-0x1 などの 10 進浮動小数点数3.14159。 ドキュメントに記載されている場合を除き、16 進数は接頭辞0xまたはを使用する必要があります。このプレフィックスは、または記号が存在する場合はその後、先頭のゼロの前に0X記述する必要があります。たとえば、有効ですが、そうではありません。+-0x001000x1 小数点で書かれた数値は、小数部分がゼロであっても、常に浮動小数点と見なされます。たとえば、42と は42.0通常交換可能ですが、常にではありません。科学表記法も認識されますが (例 1.0e4and )、小数点がなくても常に浮動小数点数が生成されます。-2.1E-4 ユーザーの地域設定でコンマが指定されている場合でも、小数点記号は常にドットです。 数値が文字列に変換されると、10 進数として書式設定されます。浮動小数点数は完全な精度でフォーマットされます (ただし、冗長な後続ゼロは破棄されます)。これにより、場合によっては不正確さが明らかになることがあります。Format関数を使用して、数値文字列を別の形式で生成します。浮動小数点数は、Round関数を使用してフォーマットすることもできます。 数値の範囲と精度の詳細については、純粋な数値を参照してください。 ブール値 ブール値は、trueまたはfalseのいずれかです。ブール値は、式の真など、可能な状態が 2 つだけあるものを表すために使用されます。たとえば、x の値が y より小さいか等しい場合、式はtrue(x = y)です。ブール値は、yesまたはno、onまたはoff、downまたはup ( GetKeyStateなど) などを表すこともできます。 AutoHotkey には特定のブール型がないため、整数値を使用して0false を表し、1true を表します。値が true または false である必要がある場合、空白またはゼロの値は false と見なされ、他のすべての値は true と見なされます。(オブジェクトは常に true と見なされます。) trueおよび という単語は、 1 と 0 を含む組み込み変数falseです。スクリプトを読みやすくするために使用できます。 なし AutoHotkey には、他の言語に見られるような、 Nothing、null、nil、またはundefinedを一意に表す値はありません。 「null」または「未定義」の値を生成する代わりに、値を持たない変数、プロパティ、配列要素、またはマップ項目を読み取ろうとすると、UnsetError がスローされます。これにより、null 値が暗黙的にコードを介して伝播することを許可されている場合よりも、エラーをより簡単に識別できます。参照 初期化されていない変数。 関数のオプション パラメータは、関数の呼び出し時に省略できます。その場合、関数は動作を変更したり、デフォルト値を使用したりできます。パラメータは通常、文字通りコードから省略されますが、unsetキーワードを使用して明示的または条件付きで省略されることもあります。この特別なシグナルは、 maybe 演算子 ( var ? )を使用して明示的にのみ伝播できます。設定されていないパラメータは、関数が実行される前にデフォルト値 (存在する場合) を自動的に受け取ります。 主に歴史的な理由から、空の文字列は、明示的な戻り値を持たない関数など、他の言語で null または未定義の値が使用される場所で使用されることがあります。 変数またはパラメーターが「空」または「空白」であると言われている場合、それは通常、空の文字列 (長さゼロの文字列) を意味します。これは、パラメーターを省略することと同じではありませんが、場合によっては同じ結果になることがあります。 オブジェクト オブジェクトは、 AutoHotkey の複合または抽象データ型です。オブジェクトは、任意の数のプロパティ(取得または設定可能) とメソッド(呼び出し可能)で構成できます。各プロパティまたはメソッドの名前と効果は、特定のオブジェクトまたはオブジェクトの種類によって異なります。 オブジェクトには次の属性があります。 オブジェクトは含まれていません。それらは参照されます。たとえば、alpha = []新しい配列を作成し、参照をalphaに格納します。bravo = alpha(オブジェクトではなく) への参照をコピーするbravoため、両方が同じオブジェクトを参照します。配列または変数がオブジェクトを含むと言われている場合、実際に含まれているのはオブジェクトへの参照です。 2 つのオブジェクト参照は、同じオブジェクトを参照している場合にのみ比較されます。 や など、ブール値が必要な場合、オブジェクトは常にtrueと見なされます。if obj!objobj ? x y 各オブジェクトには一意のアドレス (メモリ内の場所) があり、 ObjPtr関数で取得できますが、通常は直接使用されません。このアドレスはオブジェクトを一意に識別しますが、オブジェクトが解放されるまでのみです。 オブジェクトが想定外のコンテキストで使用された場合、空の文字列として扱われることがあります。たとえば、MsgBox(myObject)空の MsgBox を示しています。それ以外の場合は、TypeError がスローされる可能性があります (これは将来標準になるはずです)。
https://w.atwiki.jp/yamjack/pages/21.html
EvernoteのPython APIのページ http //dev.evernote.com/intl/jp/doc/start/python.php $ python setup.py install は2014/01/02にやった。 Gitサブモジュールとしてインストールすることも可能なようです。 最後に、Evernote SDK for Python は Python Package Index から入手可能で、pip コマンドによりインストールすることができます pip install evernote [563 evernote-sdk-python-master]$ pip install evernote Requirement already satisfied (use --upgrade to upgrade) evernote in /usr/local/lib/python2.7/site- packages/evernote-1.25.0-py2.7.egg Requirement already satisfied (use --upgrade to upgrade) oauth2 in /usr/local/lib/python2.7/site- packages/oauth2-1.5.211-py2.7.egg (from evernote) Requirement already satisfied (use --upgrade to upgrade) httplib2 in /usr/local/lib/python2.7/site- packages/httplib2-0.8-py2.7.egg (from oauth2- evernote) Cleaning up... →やってみたらこんな感じ、すでにインストールされてるのか? SDK のテスト 上記のインストール手順が完了したら、Evernote SDK for Python をプロジェクトに追加可能になっているはずです。検証するには、このコマンドをコンソールで実行し、Evernote が正常に import をクラスに含めることを確認します $ python -c from evernote.api.client import EvernoteClient コマンドが起動して終了すれば、準備完了です。 →うまくいったようだ。インポートできてるんだな。 デベロッパートークン取得ページ https //sandbox.evernote.com/api/DeveloperToken.action → ココで取得したデベロッパートークンで、サンプルのEDAMTest.pyがちゃんと動作した。 ちょっと感動(T^T) つづきは認証から、 認証 Evernote Developer 認証ページ(日本語) http //dev.evernote.com/intl/jp/doc/articles/authentication.php UserStore NoteStore 一般的なデータの種類 一般的なタスク 結論 流れ NoteStore取得 ノートブック取得 ノート作成 ノート検索 ノート更新 参考URL http //qiita.com/yshr04hrk/items/ac05dee1c45c1543ed00 http //blog.madoro.org/mn/2 http //www.antun.net/tips/api/evernote.html http //dev.evernote.com/intl/jp/doc/articles/reminders.php http //dev.evernote.com/intl/jp/doc/articles/authentication.php
https://w.atwiki.jp/autohotkey_v2/pages/20.html
Table of Contents Mouse General Buttons Advanced Buttons Wheel Keyboard General Keys Cursor Control Keys Numpad Keys Function Keys Modifier Keys Multimedia Keys Other Keys Joystick Hand-held Remote Controls Special Keys CapsLock and IME Mouse General Buttons Name Description LButton Primary mouse button. Which physical button this corresponds to depends on system settings; by default it is the left button. RButton Secondary mouse button. Which physical button this corresponds to depends on system settings; by default it is the right button. MButton Middle or wheel mouse button Advanced Buttons Name Description XButton1 4th mouse button. Typically performs the same function as Browser_Back. XButton2 5th mouse button. Typically performs the same function as Browser_Forward. Wheel Name Description WheelDown Turn the wheel downward (toward you). WheelUp Turn the wheel upward (away from you). WheelLeft WheelRight Scroll to the left or right. These can be used as hotkeys with some (but not all) mice which have a second wheel or support tilting the wheel to either side. In some cases, software bundled with the mouse must instead be used to control this feature. Regardless of the particular mouse, Send and Click can be used to scroll horizontally in programs which support it. Keyboard Note The names of the letter and number keys are the same as that single letter or digit. For example b is B and 5 is 5. Although any single character can be used as a key name, its meaning (scan code or virtual keycode) depends on the current keyboard layout. Additionally, some special characters may need to be escaped or enclosed in braces, depending on the context. The letters a-z or A-Z can be used to refer to the corresponding virtual keycodes (usually vk41-vk5A) even if they are not included in the current keyboard layout. General Keys Name Description CapsLock CapsLock (caps lock key) Note Windows IME may interfere with the detection and functionality of CapsLock; see CapsLock and IME for details. Space Space (space bar) Tab Tab (tabulator key) Enter Enter Escape (or Esc) Esc Backspace (or BS) Backspace Cursor Control Keys Name Description ScrollLock ScrollLock (scroll lock key). While Ctrl is held down, ScrollLock produces the key code of CtrlBreak, but can be differentiated from Pause by scan code. Delete (or Del) Del Insert (or Ins) Ins Home Home End End PgUp PgUp (page up key) PgDn PgDn (page down key) Up ↑ (up arrow key) Down ↓ (down arrow key) Left ← (left arrow key) Right → (right arrow key) Numpad Keys Due to system behavior, the following keys separated by a slash are identified differently depending on whether NumLock is ON or OFF. If NumLock is OFF but Shift is pressed, the system temporarily releases Shift and acts as though NumLock is ON. Name Description Numpad0 / NumpadIns 0 / Ins Numpad1 / NumpadEnd 1 / End Numpad2 / NumpadDown 2 / ↓ Numpad3 / NumpadPgDn 3 / PgDn Numpad4 / NumpadLeft 4 / ← Numpad5 / NumpadClear 5 / typically does nothing Numpad6 / NumpadRight 6 / → Numpad7 / NumpadHome 7 / Home Numpad8 / NumpadUp 8 / ↑ Numpad9 / NumpadPgUp 9 / PgUp NumpadDot / NumpadDel . / Del NumLock NumLock (number lock key). While Ctrl is held down, NumLock produces the key code of Pause, so use ^Pause in hotkeys instead of ^NumLock. NumpadDiv / (division) NumpadMult * (multiplication) NumpadAdd + (addition) NumpadSub - (subtraction) NumpadEnter Enter Function Keys Name Description F1 - F24 The 12 or more function keys at the top of most keyboards. Modifier Keys Name Description LWin Left Win. Corresponds to the # hotkey prefix. RWin Right Win. Corresponds to the # hotkey prefix. Note Unlike Ctrl/Alt/Shift, there is no generic/neutral "Win" key because the OS does not support it. However, hotkeys with the # modifier can be triggered by either Win. Control (or Ctrl) Ctrl. As a hotkey (Control ) it fires upon release unless it has the tilde prefix. Corresponds to the ^ hotkey prefix. Alt Alt. As a hotkey (Alt ) it fires upon release unless it has the tilde prefix. Corresponds to the ! hotkey prefix. Shift Shift. As a hotkey (Shift ) it fires upon release unless it has the tilde prefix. Corresponds to the + hotkey prefix. LControl (or LCtrl) Left Ctrl. Corresponds to the ^ hotkey prefix. RControl (or RCtrl) Right Ctrl. Corresponds to the ^ hotkey prefix. LShift Left Shift. Corresponds to the + hotkey prefix. RShift Right Shift. Corresponds to the + hotkey prefix. LAlt Left Alt. Corresponds to the ! hotkey prefix. RAlt Right Alt. Corresponds to the ! hotkey prefix. Note If your keyboard layout has AltGr instead of RAlt, you can probably use it as a hotkey prefix via ^ ! as described here. In addition, LControl RAlt would make AltGr itself into a hotkey. Multimedia Keys The function assigned to each of the keys listed below can be overridden by modifying the Windows registry. This table shows the default function of each key on most versions of Windows. Name Description Browser_Back Back Browser_Forward Forward Browser_Refresh Refresh Browser_Stop Stop Browser_Search Search Browser_Favorites Favorites Browser_Home Homepage Volume_Mute Mute the volume Volume_Down Lower the volume Volume_Up Increase the volume Media_Next Next Track Media_Prev Previous Track Media_Stop Stop Media_Play_Pause Play/Pause Launch_Mail Launch default e-mail program Launch_Media Launch default media player Launch_App1 Launch My Computer Launch_App2 Launch Calculator Other Keys Name Description AppsKey Menu. This is the key that invokes the right-click context menu. PrintScreen PrtSc (print screen key) CtrlBreak Ctrl+Pause or Ctrl+ScrollLock Pause Pause or Ctrl+NumLock. While Ctrl is held down, Pause produces the key code of CtrlBreak and NumLock produces Pause, so use ^CtrlBreak in hotkeys instead of ^Pause. Help Help. This probably doesn t exist on most keyboards. It s usually not the same as F1. Sleep Sleep. Note that the sleep key on some keyboards might not work with this. SCnnn Specify for nnn the scan code of a key. Recognizes unusual keys not mentioned above. See Special Keys for details. VKnn Specify for nn the hexadecimal virtual key code of a key. This rarely-used method also prevents certain types of hotkeys from requiring the keyboard hook. For example, the following hotkey does not use the keyboard hook, but as a side-effect it is triggered by pressing either Home or NumpadHome ^VK24 MsgBox "You pressed Home or NumpadHome while holding down Control." Known limitation VK hotkeys that are forced to use the keyboard hook, such as *VK24 or ~VK24, will fire for only one of the keys, not both (e.g. NumpadHome but not Home). For more information about the VKnn method, see Special Keys. Warning Only Send, GetKeyName, GetKeyVK, GetKeySC and A_MenuMaskKey support combining VKnn and SCnnn. If combined in any other case (or if any other invalid suffix is present), the key is not recognized. For example, vk1Bsc001 raises an error. Joystick Joy1 through Joy32 The buttons of the joystick. To help determine the button numbers for your joystick, use this test script. Note that hotkey prefix symbols such as ^ (control) and + (shift) are not supported (though GetKeyState can be used as a substitute). Also note that the pressing of joystick buttons always "passes through" to the active window if that window is designed to detect the pressing of joystick buttons. Although the following Joystick control names cannot be used as hotkeys, they can be used with GetKeyState JoyX, JoyY, and JoyZ The X (horizontal), Y (vertical), and Z (altitude/depth) axes of the joystick. JoyR The rudder or 4th axis of the joystick. JoyU and JoyV The 5th and 6th axes of the joystick. JoyPOV The point-of-view (hat) control. JoyName The name of the joystick or its driver. JoyButtons The number of buttons supported by the joystick (not always accurate). JoyAxes The number of axes supported by the joystick. JoyInfo Provides a string consisting of zero or more of the following letters to indicate the joystick s capabilities Z (has Z axis), R (has R axis), U (has U axis), V (has V axis), P (has POV control), D (the POV control has a limited number of discrete/distinct settings), C (the POV control is continuous/fine). Example string ZRUVPD Multiple Joysticks If the computer has more than one joystick and you want to use one beyond the first, include the joystick number (max 16) in front of the control name. For example, 2joy1 is the second joystick s first button. Note If you have trouble getting a script to recognize your joystick, one person reported needing to specify a joystick number other than 1 even though only a single joystick was present. It is unclear how this situation arises or whether it is normal, but experimenting with the joystick number in the joystick test script can help determine if this applies to your system. See Also Joystick remapping Methods of sending keystrokes and mouse clicks with a joystick. Joystick-To-Mouse script Using a joystick as a mouse. Hand-held Remote Controls Respond to signals from hand-held remote controls via the WinLIRC client script. Special Keys If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting "View- Key history" from the menu bar. Double-click that script s tray icon to open its main window. Press one of the "mystery keys" on your keyboard. Select the menu item "View- Key history" Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below. If your key is detectable, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159). To define this key as a hotkey, follow this example SC159 MsgBox ThisHotkey " was pressed." ; Replace 159 with your key s value. Also see ThisHotkey. Reverse direction To remap some other key to become a "mystery key", follow this example ; Replace 159 with the value discovered above. Replace FF (if needed) with the ; key s virtual key, which can be discovered in the first column of the Key History screen. c Send "{vkFFsc159}" ; See Send {vkXXscYYY} for more details. Alternate solutions If your key or mouse button is not detectable by the Key History screen, one of the following might help Reconfigure the software that came with your mouse or keyboard (sometimes accessible in the Control Panel or Start Menu) to have the "mystery key" send some other keystroke. Such a keystroke can then be defined as a hotkey in a script. For example, if you configure a mystery key to send Ctrl+F1, you can then indirectly make that key as a hotkey by using ^F1 in a script. Try AHKHID. You can also try searching the forum for a keywords like RawInput*, USB HID or AHKHID. The following is a last resort and generally should be attempted only in desperation. This is because the chance of success is low and it may cause unwanted side-effects that are difficult to undo Disable or remove any extra software that came with your keyboard or mouse or change its driver to a more standard one such as the one built into the OS. This assumes there is such a driver for your particular keyboard or mouse and that you can live without the features provided by its custom driver and software. CapsLock and IME Some configurations of Windows IME (such as Japanese input with English keyboard) use CapsLock to toggle between modes. In such cases, CapsLock is suppressed by the IME and cannot be detected by AutoHotkey. However, the Alt+CapsLock, Ctrl+CapsLock and Shift+CapsLock shortcuts can be disabled with a workaround. Specifically, send a key-up to modify the state of the IME, but prevent any other effects by signalling the keyboard hook to suppress the event. The following function can be used for this purpose ; The keyboard hook must be installed. InstallKeybdHook SendSuppressedKeyUp(key) { DllCall("keybd_event" , "char", GetKeyVK(key) , "char", GetKeySC(key) , "uint", KEYEVENTF_KEYUP = 0x2 , "uptr", KEY_BLOCK_THIS = 0xFFC3D450) } After copying the function into a script or saving it as SendSuppressedKeyUp.ahk in a Lib folder and adding #Include to the script, it can be used as follows ; Disable Alt+key shortcuts for the IME. ~LAlt SendSuppressedKeyUp "LAlt" ; Test hotkey !CapsLock MsgBox A_ThisHotkey ; Remap CapsLock to LCtrl in a way compatible with IME. CapsLock { Send "{Blind}{LCtrl DownR}" SendSuppressedKeyUp "LCtrl" } CapsLock up { Send "{Blind}{LCtrl Up}" }
https://w.atwiki.jp/utdis11/pages/14.html
そもそもEvernoteってなに?って人も多いかと思いますので、一応説明を。 簡単に言ってしまえば、みんなで共同編集できるパソコン上の電子ノートのことです。 なんで便利かと言いますと、 簡単にネットから情報をコピペしてきたりすることができるから! 色々なソフトと組み合わせて活用できる! の2点に尽きます。(情報共有できるのはあたりまえ!) ということで、さっそく導入方法をば。(Windows編。Macはググろう!) http //www.evernote.com/about/intl/jp/ ここからEvernote for Windowsをダウンロード! あとは、 gmailのアカウントと同じアドレス&パスワードでログインできます。 ちなみに、EvernoteはChromeやFirefoxにも拡張機能があったりしますのでググって確認しておくと得かも。 分からなかったら俺に言ってください! そしたらまたなんか補足書くので。 名前 コメント
https://w.atwiki.jp/autohotkey_v2/pages/18.html
Table of Contents Introduction and Simple Examples Ending Characters Options Long Replacements Context-sensitive Hotstrings AutoCorrect Remarks Named Function Hotstrings Hotstring Helper Introduction and Simple Examples Although hotstrings are mainly used to expand abbreviations as you type them (auto-replace), they can also be used to launch any scripted action. In this respect, they are similar to hotkeys except that they are typically composed of more than one character (that is, a string). To define a hotstring, enclose the triggering abbreviation between pairs of colons as in this example btw by the way In the above example, the abbreviation btw will be automatically replaced with "by the way" whenever you type it (however, by default you must type an ending character after typing btw, such as Space, ., or Enter). The "by the way" example above is known as an auto-replace hotstring because the typed text is automatically erased and replaced by the string specified after the second pair of colons. By contrast, a hotstring may also be defined to perform any custom action as in the following examples. Note that the functions must appear beneath the hotstring btw { MsgBox You typed "btw". } * ]d ; This hotstring replaces "]d" with the current date and time via the functions below. { SendInput FormatTime(, "M/d/yyyy h mm tt") ; It will look like 9/1/2005 3 53 PM } In the above, the braces serve to define a function body for each hotstring. The opening brace may also be specified on the same line as the double-colon to support the OTB (One True Brace) style. Even though the two examples above are not auto-replace hotstrings, the abbreviation you type is erased by default. This is done via automatic backspacing, which can be disabled via the b0 option. When a hotstring is triggered, the name of the hotstring is passed as its first parameter named ThisHotkey (which excludes the trailing colons). For example X btw MsgBox ThisHotkey ; Reports X btw With few exceptions, this is similar to the built-in variable A_ThisHotkey. The parameter name can be changed by using a named function. Ending Characters Unless the asterisk option is in effect, you must type an ending character after a hotstring s abbreviation to trigger it. Ending characters initially consist of the following -()[]{} ;"/\,.?!nt (note that n is Enter,t is Tab, and there is a plain space between n andt). This set of characters can be changed by editing the following example, which sets the new ending characters for all hotstrings, not just the ones beneath it Hotstring EndChars -()[]{} ; "/\,.?!nt The ending characters can be changed while the script is running by calling the Hotstring function as demonstrated below Hotstring("EndChars", "-()[]{} ;") Options A hotstring s default behavior can be changed in two possible ways The #Hotstring directive, which affects all hotstrings physically beneath that point in the script. The following example puts the C and R options into effect #Hotstring c r. Putting options inside a hotstring s first pair of colons. The following example puts the C and options (case sensitive and "ending character not required") into effect for a single hotstring c j@ john@somedomain.com. The list below describes each option. When specifying more than one option using the methods above, spaces optionally may be included between them. (asterisk) An ending character (e.g. Space, ., or Enter) is not required to trigger the hotstring. For example j@ jsmith@somedomain.com The example above would send its replacement the moment you type the @ character. When using the #Hotstring directive, use 0 to turn this option back off. ? (question mark) The hotstring will be triggered even when it is inside another word; that is, when the character typed immediately before it is alphanumeric. For example, if ? al airline is a hotstring, typing "practical " would produce "practicairline ". Use ?0 to turn this option back off. B0 (B followed by a zero) Automatic backspacing is not done to erase the abbreviation you type. Use a plain B to turn backspacing back on after it was previously turned off. A script may also do its own backspacing via {bs 5}, which sends Backspace five times. Similarly, it may send ← five times via {left 5}. For example, the following hotstring produces "" and moves the caret 5 places to the left (so that it s between the tags) *b0 {left 5} C Case sensitive When you type an abbreviation, it must exactly match the case defined in the script. Use C0 to turn case sensitivity back off. C1 Do not conform to typed case. Use this option to make auto-replace hotstrings case insensitive and prevent them from conforming to the case of the characters you actually type. Case-conforming hotstrings (which are the default) produce their replacement text in all caps if you type the abbreviation in all caps. If you type the first letter in caps, the first letter of the replacement will also be capitalized (if it is a letter). If you type the case in any other way, the replacement is sent exactly as defined. When using the #Hotstring directive, C0 can be used to turn this option back off, which makes hotstrings conform again. Kn Key-delay This rarely-used option sets the delay between keystrokes produced by auto-backspacing or auto-replacement. Specify the new delay for n; for example, specify k10 to have a 10ms delay and k-1 to have no delay. The exact behavior of this option depends on which sending mode is in effect SI (SendInput) Key-delay is ignored because a delay is not possible in this mode. The exception to this is when SendInput is unavailable, in which case hotstrings revert to SendPlay mode below (which does obey key-delay). SP (SendPlay) A delay of length zero is the default, which for SendPlay is the same as -1 (no delay). In this mode, the delay is actually a PressDuration rather than a delay between keystrokes. SE (SendEvent) A delay of length zero is the default. Zero is recommended for most purposes since it is fast but still cooperates well with other processes (due to internally doing a Sleep 0). Specify k-1 to have no delay at all, which is useful to make auto-replacements faster if your CPU is frequently under heavy load. When set to -1, a script s process-priority becomes an important factor in how fast it can send keystrokes. To raise a script s priority, use ProcessSetPriority "High". O Omit the ending character of auto-replace hotstrings when the replacement is produced. This is useful when you want a hotstring to be kept unambiguous by still requiring an ending character, but don t actually want the ending character to be shown on the screen. For example, if o ar aristocrat is a hotstring, typing "ar" followed by the spacebar will produce "aristocrat" with no trailing space, which allows you to make the word plural or possessive without having to press Backspace. Use O0 (the letter O followed by a zero) to turn this option back off. Pn The priority of the hotstring (e.g. P1). This rarely-used option has no effect on auto-replace hotstrings. R Send the replacement text raw; that is, without translating {Enter} to Enter, ^c to Ctrl+C, etc. Use R0 to turn this option back off, or override it with T. Note Text mode may be more reliable. The R and T options are mutually exclusive. S or S0 Specify the letter S to make the hotstring exempt from Suspend. Specify S0 (S with the number 0) to remove the exemption, allowing the hotstring to be suspended. When applied as a default option, either S or #SuspendExempt will make the hotstring exempt; that is, to override the directive, S0 must be used explicitly in the hotstring. SI or SP or SE Sets the method by which auto-replace hotstrings send their keystrokes. These options are mutually exclusive only one can be in effect at a time. The following describes each option SI stands for SendInput, which typically has superior speed and reliability than the other modes. Another benefit is that like SendPlay below, SendInput postpones anything you type during a hotstring s auto-replacement text. This prevents your keystrokes from being interspersed with those of the replacement. When SendInput is unavailable, hotstrings automatically use SendPlay instead. SP stands for SendPlay, which may allow hotstrings to work in a broader variety of games. SE stands for SendEvent. If none of the above options are used, the default mode is SendInput. However, unlike the SI option, SendEvent is used instead of SendPlay when SendInput is unavailable. T Send the replacement text using Text mode. That is, send each character by character code, without translating {Enter} to Enter, ^c to Ctrl+C, etc. and without translating each character to a keystroke. This option is put into effect automatically for hotstrings that have a continuation section. Use T0 or R0 to turn this option back off, or override it with R. X Execute. Instead of replacement text, the hotstring accepts a function call or expression to execute. For example, X ~mb MsgBox would cause a message box to be displayed when the user types "~mb" instead of auto-replacing it with the word "MsgBox". This is most useful when defining a large number of hotstrings which call functions, as it would otherwise require three lines per hotstring. This option should not be used with the Hotstring function. To make a hotstring call a function when triggered, pass the function by reference. Z This rarely-used option resets the hotstring recognizer after each triggering of the hotstring. In other words, the script will begin waiting for an entirely new hotstring, eliminating from consideration anything you previously typed. This can prevent unwanted triggerings of hotstrings. To illustrate, consider the following hotstring b0*? 11 { SendInput "xx" } Since the above lacks the Z option, typing 111 (three consecutive 1 s) would trigger the hotstring twice because the middle 1 is the last character of the first triggering but also the first character of the second triggering. By adding the letter Z in front of b0, you would have to type four 1 s instead of three to trigger the hotstring twice. Use Z0 to turn this option back off. Long Replacements Hotstrings that produce a large amount of replacement text can be made more readable and maintainable by using a continuation section. For example text1 ( Any text between the top and bottom parentheses is treated literally. By default, the hard carriage return (Enter) between the previous line and this one is also preserved. By default, the indentation (tab) to the left of this line is preserved. ) See continuation section for how to change these default behaviors. The presence of a continuation section also causes the hotstring to default to Text mode. The only way to override this special default is to specify an opposing option in each hotstring that has a continuation section (e.g. t0 text1 or r text2 ). Context-sensitive Hotstrings The #HotIf directive can be used to make selected hotstrings context sensitive. Such hotstrings send a different replacement, perform a different action, or do nothing at all depending on any condition, such as the type of window that is active. For example HotIf WinActive("ahk_class Notepad") btw This replacement text will appear only in Notepad. HotIf btw This replacement text appears in windows other than Notepad. AutoCorrect The following script uses hotstrings to correct about 4700 common English misspellings on-the-fly. It also includes a Win+H hotkey to make it easy to add more misspellings Download AutoCorrect.ahk (127 KB) Author Jim Biancolo and Wikipedia s Lists of Common Misspellings Remarks Expressions are not currently supported within the replacement text. To work around this, don t make such hotstrings auto-replace. Instead, use the SendInput function beneath the abbreviation, followed by a line containing only the word Return. To send an extra space or tab after a replacement, include the space or tab at the end of the replacement but make the last character an accent/backtick (`). For example btw By the way ` For an auto-replace hotstring which doesn t use the Text or Raw mode, sending a { alone, or one preceded only by white-space, requires it being enclosed in a pair of brackets, for example brace {{} and * space_brace {{}. Otherwise it is interpreted as the opening brace for the hotstring s function to support the OTB (One True Brace) style. By default, any click of the left or right mouse button will reset the hotstring recognizer. In other words, the script will begin waiting for an entirely new hotstring, eliminating from consideration anything you previously typed (if this is undesirable, specify the line #Hotstring NoMouse anywhere in the script). This "reset upon mouse click" behavior is the default because each click typically moves the text insertion point (caret) or sets keyboard focus to a new control/field. In such cases, it is usually desirable to 1) fire a hotstring even if it lacks the question mark option; 2) prevent a firing when something you type after clicking the mouse accidentally forms a valid abbreviation with what you typed before. The hotstring recognizer checks the active window each time a character is typed, and resets if a different window is active than before. If the active window changes but reverts before any characters are typed, the change is not detected (but the hotstring recognizer may be reset for some other reason). The hotstring recognizer can also be reset by calling Hotstring "Reset". The built-in variable A_EndChar contains the ending character that you typed to trigger the most recent non-auto-replace hotstring. If no ending character was required (due to the * option), it will be blank. A_EndChar is useful when making hotstrings that use the Send function or whose behavior should vary depending on which ending character you typed. To send the ending character itself, use SendText A_EndChar (SendText is used because characters such as !{} would not be sent correctly by the normal Send function). Although single-colons within hotstring definitions do not need to be escaped unless they precede the double-colon delimiter, backticks and those semicolons having a space or tab to their left must always be escaped. See Escape Sequences for a complete list. Although the Send function s special characters such as {Enter} are supported in auto-replacement text (unless the raw option is used), the hotstring abbreviations themselves do not use this. Instead, specify n for Enter andt (or a literal tab) for Tab (see Escape Sequences for a complete list). For example, the hotstring * ab`t would be triggered when you type "ab" followed by a tab. Spaces and tabs are treated literally within hotstring definitions. For example, the following would produce two different results btw by the way and btw by the way. Each hotstring abbreviation can be no more than 40 characters long. The program will warn you if this length is exceeded. By contrast, the length of hotstring s replacement text is limited to about 5000 characters when the sending mode is at its default of SendInput. That limit can be removed by switching to one of the other sending modes, or by using SendPlay or SendEvent in the body of the hotstring. The order in which hotstrings are defined determines their precedence with respect to each other. In other words, if more than one hotstring matches something you type, only the one listed first in the script will take effect. Related topic context-sensitive hotstrings. Any backspacing you do is taken into account for the purpose of detecting hotstrings. However, the use of ↑, →, ↓, ←, PgUp, PgDn, Home, and End to navigate within an editor will cause the hotstring recognition process to reset. In other words, it will begin waiting for an entirely new hotstring. A hotstring may be typed even when the active window is ignoring your keystrokes. In other words, the hotstring will still fire even though the triggering abbreviation is never visible. In addition, you may still press Backspace to undo the most recently typed keystroke (even though you can t see the effect). A hotstring s function can be called explicitly by the script only if the function has been named. See Named Function Hotstrings. Hotstrings are not monitored and will not be triggered while input is blocked by an invisible Input hook. By default, hotstrings are never triggered by keystrokes produced by any AutoHotkey script. This avoids the possibility of an infinite loop where hotstrings trigger each other over and over. This behaviour can be controlled with #InputLevel and SendLevel. However, auto-replace hotstrings always use send level 0 and therefore never trigger hook hotkeys or hotstrings. Hotstrings can be created dynamically by means of the Hotstring function, which can also modify, disable, or enable the script s existing hotstrings individually. The InputHook function is more flexible than hotstrings for certain purposes. For example, it allows your keystrokes to be invisible in the active window (such as a game). It also supports non-character ending keys such as Esc. The keyboard hook is automatically used by any script that contains hotstrings. Hotstrings behave identically to hotkeys in the following ways They are affected by the Suspend function. They obey #MaxThreads and #MaxThreadsPerHotkey (but not #MaxThreadsBuffer). Scripts containing hotstrings are automatically persistent. Non-auto-replace hotstrings will create a new thread when launched. In addition, they will update the built-in hotkey variables such as A_ThisHotkey. Known limitation On some systems in Java applications, hotstrings might interfere with the user s ability to type diacritical letters (via dead keys). To work around this, Suspend can be turned on temporarily (which disables all hotstrings). Named Function Hotstrings If the function of a hotstring is ever needed to be called without triggering the hotstring itself, one or more hotstrings can be assigned a named function by simply defining it immediately after the hotstring s double-colon, as in this example ; This example also demonstrates one way to implement case conformity in a script. C BTW ; Typed in all-caps. C Btw ; Typed with only the first letter upper-case. btw ; Typed in any other combination. case_conform_btw(hs) ; hs will hold the name of the hotstring which triggered the function. { if (hs == " C BTW") Send "BY THE WAY" else if (hs == " C Btw") Send "By the way" else Send "by the way" } If the function case_conform_btw is ever called explicitly by the script, the first parameter (hs) must be passed a value. Hotkeys can also be defined this way. Multiple hotkeys or hotstrings can be stacked together to call the same function. There must only be whitespace or comments between the hotstring and the function name. Naming the function also encourages self-documenting hotstrings, like in the code above where the function name describes the hotstring. The Hotstring function can also be used to assign a function or function object to a hotstring. Hotstring Helper Take a look at the first example in the example section of the Hotstring function s page, which might be useful if you are a heavy user of hotstrings. By pressing Win+H (or another hotkey of your choice), the currently selected text can be turned into a hotstring. For example, if you have "by the way" selected in a word processor, pressing Win+H will prompt you for its abbreviation (e.g. btw), add the new hotstring to the script and activate it.
https://w.atwiki.jp/autohotkey_v2/pages/15.html
AutoHotkey スクリプトは基本的に、AutoHotkey 専用のカスタム言語で書かれた、プログラムが従う一連の命令です。 この言語は、他のいくつかのスクリプト言語といくつかの類似点がありますが、独自の長所と落とし穴もあります。 このドキュメントでは、言語について説明し、よくある落とし穴を指摘しようとします。 AutoHotkey で利用されるさまざまな概念のより一般的な説明については、概念と規則を参照してください。 目次 一般規約 コメント 式 文字列/テキスト 変数 定数 オペレーター 関数呼び出し 関数呼び出しステートメント オプションのパラメータ オブジェクトの演算子 式ステートメント 制御フロー ステートメント 制御フローとその他のステートメント ループ文 フローを制御しない スクリプトの構造 グローバルコード 機能 #含む その他 動的変数 疑似配列 ラベル 一般規約 名前 変数名と関数名では大文字と小文字が区別されません (たとえば、CurrentDate は currentdate と同じです)。 最大長や使用可能な文字などの詳細については、名前を参照してください。 型付き変数なし 変数には明示的に定義された型がありません。 代わりに、任意の型の値を任意の変数に格納できます (定数と組み込み変数を除く)。 状況に応じて、数値は文字列 (テキスト) に、またはその逆に自動的に変換される場合があります。 宣言はオプションです 関数のページに記載されている場合を除き、変数を宣言する必要はありません。 ただし、値が与えられる前に変数を読み取ろうとすると、エラーと見なされます。 スペースはほとんど無視されます インデント (先頭のスペース) は、読み取り可能なコードを記述するために重要ですが、プログラムでは必要ないため、通常は無視されます。 スペースとタブは通常、行末と式内 (引用符の間を除く) では無視されます。 ただし、次のような場合にはスペースが重要になります。 関数とメソッドの呼び出しでは、関数/メソッド名と (. 連結する場合はスペースが必要です。 あいまいさをなくすために、2 つの演算子の間にスペースが必要になる場合があります。 単一行のコメントは、行の先頭にない場合、先頭にスペースが必要です。 改行は意味があります 通常、改行はステートメントの区切りとして機能し、前の関数呼び出しまたは他のステートメントを終了します。 (ステートメントは、実行される何らかのアクションを表現する言語の最小のスタンドアロン要素です。) これの例外は、行の継続です (以下を参照)。 行の継続 読みやすさと保守性を向上させるために、長い行を小さな行のコレクションに分割できます。 これは前処理によって実現されるため、言語自体の一部ではありません。 次の 3 つの方法があります。 継続プレフィックス 式演算子 (++ と -- を除く) で始まる行は、前の行とマージされます。 行に実際に式が含まれているかどうかに関係なく、行はマージされます。 囲みによる継続 ()、[]、または {} で囲まれた部分式は、ほとんどの場合、自動的に複数の行にまたがることができます。 継続セクション 複数の行は、( で始まり ) で終わるセクションの上の行とマージされます (空白を除いて、両方の記号が行の先頭に表示される必要があります)。 コメント コメントは、プログラムによって無視されるスクリプト内のテキストの一部です。 これらは通常、説明を追加したり、コードの一部を無効にするために使用されます。 スクリプトは、行頭にセミコロンを使用してコメントを付けることができます。 例えば: ; この行全体がコメントです。 行末にコメントを追加することもできます。その場合、セミコロンの左側に少なくとも 1 つのスペースまたはタブが必要です。 例えば: 「メモ帳」を実行します。 これは、関数呼び出しと同じ行のコメントです。 さらに、次の例のように、/ および / 記号を使用して、セクション全体をコメント化できます。 / MsgBox "この行はコメントアウト (無効) されています。" MsgBox "よくある間違い " / "コメントはこれで終わりではありません。" MsgBox "この行はコメントアウトされています。" / MsgBox "この行はコメントアウトされていません。" / これも有効ですが、他のコードは回線を共有できません。 / MsgBox "この行はコメントアウトされていません。" タブとスペースを除いて、/ は行の先頭に表示する必要がありますが、/ は行の先頭または末尾にのみ表示できます。 / を省略しても有効です。省略した場合、ファイルの残りの部分はコメント アウトされます。 スクリプトがファイルから読み取られるときにコメントが除外されるため、パフォーマンスやメモリ使用率に影響を与えることはありません。 式 式は、1 つ以上の値、変数、演算子、および関数呼び出しの組み合わせです。 たとえば、10、1+1、および MyVar は有効な式です。 通常、式は 1 つ以上の値を入力として受け取り、1 つ以上の演算を実行して、結果として値を生成します。 式の値を見つけるプロセスは、評価と呼ばれます。 たとえば、式 1+1 は数値 2 に評価されます。 単純な式を組み合わせて、ますます複雑な式を形成できます。 たとえば、割引/100
https://w.atwiki.jp/marokubi/pages/26.html
http //www.evernote.com/ Windows上でノートをつくると Webからのコピペ等でリッチテキストになってしまう。 (リッチテキストだと、iPhoneからのノートの編集ができない) →対策を調査中(テキストエディタに一旦コピペするしかない???)